import { http } from '@/utils/http/axios';

export interface MaterialCategory {
  categoryId: number;
  categoryName: string;
  state: number;
  key: string;
  parentId: number;
  ranking: number;
}

export function getMaterialCategory() {
  return http.request({
    url: '/material/category',
    method: 'get',
  });
}

export function addMaterialCategory(params) {
  return http.request({
    url: '/material/category',
    method: 'post',
    params,
  });
}

export function deleteMaterialCategoryById(id) {
  return http.request({
    url: `/material/category/${id}`,
    method: 'delete',
  });
}

export function updateMaterialCategory(params) {
  return http.request({
    url: '/material/category',
    method: 'put',
    params,
  });
}
